
# 打包
mvn clean package -Dmaven.test.skip=true

# 删除原image
docker rmi $IMAGE_NAME
echo "=== docker rmi $IMAGE_NAME successfully ==="

# 打新image
docker build -t $IMAGE_NAME .
echo "=== docker build $IMAGE_NAME successfully ==="

# 打tag以便上传remote
docker tag $IMAGE_NAME $HARBOR_HOST/$IMAGE_NAME

# push remote
docker login $HARBOR_HOST -u $HARBOR_USERNAME -p $HARBOR_PWD
docker push $HARBOR_HOST/$IMAGE_NAME
echo "============================= docker push $HARBOR_HOST/$IMAGE_NAME successfully ============================="


